/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.controllers;

import com.entities.Transactions;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author ben
 */
@Stateless
public class TransactionController {

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

    @PersistenceContext
    private EntityManager em;
    
    
    public Transactions saveTransaction(Transactions transactions)
    {
        try {
            
            em.persist(transactions);
            return transactions;
            
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    
}
